package com.laoluo.erp.service.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import com.laoluo.erp.dao.OrdersItemDAO;
import com.laoluo.erp.domain.OrdersItem;
import com.laoluo.erp.service.OrdersItemService;
import com.laoluo.erp.util.PageListData;

@Service
public class OrdersItemServiceImpl implements OrdersItemService {

	private OrdersItemDAO dao;

	@Resource(name="ordersItemDAOImpl")
	public void setDao(OrdersItemDAO dao){
		this.dao = dao;
	}

	public void save(OrdersItem ordersItem){
		dao.save(ordersItem);
	}

	public void delete(OrdersItem ordersItem){
		dao.delete(ordersItem);
	}

	public void delete(Integer id) {
		dao.delete(OrdersItem.class,id);
	}

	public void update(OrdersItem ordersItem){
		dao.update(ordersItem);
	}

	public OrdersItem findById(Integer id) {
		return dao.findById(OrdersItem.class, id);
	}

	public List<OrdersItem> findAll() {
		return dao.findAll(OrdersItem.class);
	}

	@SuppressWarnings({ "rawtypes", "unchecked" })
	public PageListData queryPage(Map param, int start, int limit,int page) {
		param.put("start", start); 
		param.put("limit", limit);
		return dao.queryPage(OrdersItem.class, param, start,limit,page);
	}
}
